package com.neussoft.neu24.dibuy.controller;

import com.neussoft.neu24.dibuy.entity.Demo;
import com.neussoft.neu24.dibuy.service.IDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * @program: learn
 * @description:
 * @author: Jingdi.Duan ,duanjingdi@msn.com
 * @create: 2024-07-10 15:37
 **/

@RestController
@RequestMapping(value = "/d")
public class DemoController {
    @Autowired
    private IDemoService service;

    @RequestMapping(value = "/add")
    public Mono<Demo> addDemo(Demo demo) {
        System.out.println(demo);
        return service.addDemo(demo);
    }


    @PostMapping(value = "/mod")
    public Mono<Demo> modDemo(Demo demo) {
        System.out.println(demo);
        return service.updateDemo(demo);
    }
}
